package com.lb.util;

import java.util.HashMap;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;

/**
 * @ClassName Test
 * @Author hp
 * @Date 2021/12/28 20:52
 * @Version 1.0
 **/
public class Test {
    public static void main(String[] args) {

//        //返回 JVM 堆大小
//        long initalMemory = Runtime.getRuntime().totalMemory() / 1024 /1024;
//        //返回 JVM 堆的最大内存
//        long maxMemory = Runtime.getRuntime().maxMemory() / 1024 /1024;
//
//        System.out.println("-Xms : "+initalMemory + "M");
//        System.out.println("系统内存大小：" + initalMemory * 64 / 1024 + "G");
//        System.out.println("系统内存大小：" + maxMemory * 4 / 1024 + "G");
        Integer[] nums = {2,1,3,2,3,5};
        Test.searchNum(nums);
    }

    public static void searchNum(Integer[] nums){
        Map<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < nums.length; i++) {
            if(map.containsKey(nums[i])){
                map.remove(nums[i]);
            }else{
                map.put(nums[i],i);
            }
        }
        for (Integer num : map.keySet()) {
            System.out.print(num+" ");
        }
    }

}
